package com.chinasofti.demo06;

interface Swimming{
    void swim();
}

public class Test2 {
    public static void main(String[] args) {
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("我们去游泳吧...");
            }
        });
    }
    //使用接口方法
    public static void goSwimming(Swimming swimming){
//        Swimming swim = new Swimming() {
//            @Override
//            public void swim() {
//                System.out.println("我们去游泳吧...");
//            }
//        };
        swimming.swim();
    }

}
